﻿namespace FlitBit.Cache
{
	/// <summary>
	///   Collects a cache's statistics.
	/// </summary>
	public interface ICacheStatsCollector
	{
		/// <summary>
		///   Increments evicitons.
		/// </summary>
		void IncrementEvictions();

		/// <summary>
		///   Increments evicitons by <paramref name="count" />.
		/// </summary>
		void IncrementEvictions(int count);

		/// <summary>
		///   Increments expirations.
		/// </summary>
		void IncrementExpired();

		/// <summary>
		///   Increments hits by <paramref name="count" />.
		/// </summary>
		void IncrementHits(int count);

		/// <summary>
		///   Increments read attempts. This is the base of various ratios.
		/// </summary>
		void IncrementReadAttempts();

		/// <summary>
		///   Increments removals.
		/// </summary>
		void IncrementRemoves();

		/// <summary>
		///   Increments writes.
		/// </summary>
		void IncrementWrites();

		/// <summary>
		///   Samples the current statistics.
		/// </summary>
		/// <returns></returns>
		CacheStats Sample();
	}
}